package com.gyc.simple.sysuser.thread;

public class Firstthread extends Thread
{
    private int i=5;

    @Override
     synchronized public void run() {
            i--;
            System.out.println("由"+this.currentThread().getName()+"计算，count="+i);
    }

    public static void main(String args[]){
        Firstthread firstthread = new Firstthread();
        Thread thread1 = new Thread(firstthread,"a");
        Thread thread2 = new Thread(firstthread,"b");
        Thread thread3 = new Thread(firstthread,"c");
        Thread thread4 = new Thread(firstthread,"d");
        Thread thread5 = new Thread(firstthread,"e");
        Thread thread6 = new Thread(firstthread,"f");
        Thread thread7 = new Thread(firstthread,"g");
        Thread thread8 = new Thread(firstthread,"h");
        Thread thread9 = new Thread(firstthread,"u");
        Thread thread10 = new Thread(firstthread,"y");
        Thread thread11 = new Thread(firstthread,"t");
        Thread thread12 = new Thread(firstthread,"r");
        Thread thread13 = new Thread(firstthread,"w");
        Thread thread14 = new Thread(firstthread,"q");
        Thread thread15 = new Thread(firstthread,"n");
        Thread thread16 = new Thread(firstthread,"m");

        thread1.start();
        thread2.start();
        thread3.start();
        thread4.start();
        thread5.start();
        thread6.start();
        thread7.start();
        thread8.start();
        thread9.start();
        thread10.start();
        thread11.start();
        thread12.start();
        thread13.start();
        thread14.start();
        thread15.start();
        thread16.start();

    }
}
